import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    children:[
      {
        path: '/hom',
        name: 'hom',
        component: () => import('../views/hom.vue')
      },
      {
        path: '/ke',
        name: 'ke',
        component: () => import('../views/course/ke.vue')
      },
      {
        path: '/yue',
        name: 'yue',
        component: () => import('../views/yue.vue')
      },
      {
        path: '/lian',
        name: 'lian',
        component: () => import('../views/lian.vue')
      },
      {
        path: '/my',
        name: 'my',
        component: () => import('../views/my.vue')
      }
    ],
    redirect:"/hom"
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/part',
    name: 'part',
    component: () => import('../views/particulars.vue')
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('../views/course/search.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login/login.vue')
  },
  {
    path: '/smsLogin',//注册
    name: 'SmsLogin',
    component: () => import('../views/login/smsLogin.vue')
  },
  {
    path: '/ForgetPass',//找回密码
    name: 'ForgetPass',
    component: () => import('../views/login/ForgetPass.vue')
  },
  {
    path: '/oto',//oto约课
    name: 'oto',
    component: () => import('../views/oto/oto.vue')
  },
  {
    path: '/Info',//个人信息
    name: 'Info',
    component: () => import('../views/Info.vue')
  },
  {
    path: '/set-info',//修改昵称
    name: 'SetInfo',
    component: () => import('../views/setInfo.vue')
  },
  {
    path: '/set-message',//信息填写
    name: 'SetMessage',
    component: () => import('../views/setMessage.vue')
  },
  {
    path: '/my-study',//我的特色课
    name: 'MyStudy',
    component: () => import('../views/MyStudy.vue')
  },
  {
    path: '/studyDate',//我的特色课
    name: 'studyDate',
    component: () => import('../views/studyDate.vue')
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
